//
//  ImgViewController.m
//  A1.0
//
//  Created by lanou3g on 15-4-9.
//  Copyright (c) 2015年 ccandxx. All rights reserved.
//

#import "ImgViewController.h"
#import "UIImageView+WebCache.h"
#import "UIImageView+HighlightedWebCache.h"
#import "SDWebImageManager.h"
#import "SDWebImageDecoder.h"


@interface ImgViewController ()

@end

@implementation ImgViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UIImageView *CollImage = [[UIImageView alloc]initWithFrame:self.view.frame];
    
    CollImage.backgroundColor = [UIColor whiteColor];
    
    NSURL *url = [NSURL URLWithString:self.model.pic];
    NSLog(@"%@",self.model.pic);
    
    [CollImage  sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cat.png"]];
    

    
    UIButton *button = [UIButton buttonWithType:(UIButtonTypeSystem)];
    button.frame = CGRectMake(15, 30, 45, 40);
    button.backgroundColor = [UIColor whiteColor];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [button.layer setMasksToBounds:YES];
    [button.layer setCornerRadius:10];
    [button.layer setBorderWidth:2];

    [button setTitle:@"返回" forState:(UIControlStateNormal)];
    
    
     [self.view addSubview:CollImage];
    [self.view addSubview:button];

   
    
    
   
    
    
    
    
    // Do any additional setup after loading the view.
}


-(void)buttonAction:(UIButton *)sender

{
    //NSLog(@"回去吧");
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
